export default defineEventHandler(async (event) => {
  const body = await readBody(event);

  // 模拟保存属性Schema
  const schema = {
    id: body.id,
    resourceId: body.id,
    type: body.type, // 'manual', 'vbenform', 'formcreate'
    schema: body.rules || body.schema || {},
    options: body.options || {},
    createTime: Date.now(),
    updateTime: Date.now(),
  };

  // 这里应该保存到数据库
  console.log('保存资源属性Schema:', schema);

  return {
    code: 200,
    data: schema,
    message: '保存成功',
  };
});
